package com.game.center.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.LinkedBlockingQueue;

/**
 *
 * @TableName player
 */
@TableName(value ="player")
@Data
public class Player implements Serializable {
    /**
     *
     */
    @TableId
    private Long playerId;

    /**
     *
     */
    private String nickName;

    /**
     *
     */
    private Integer level;

    /**
     *
     */
    private Date lastLoginTime;

    /**
     *
     */
    private Date createTime;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    //测试的时候使用的，正式情况下，要使用线程安全的ConcurrentHashMap
    @TableField(exist = false)
    private ConcurrentHashMap<String, String> heros = new ConcurrentHashMap<>();
    @TableField(exist = false)
    private ConcurrentHashMap<String, Hero> herosMap = new ConcurrentHashMap<>();
    @TableField(exist = false)
    private ConcurrentHashMap<String, Integer> map = new ConcurrentHashMap<String, Integer>();
    @TableField(exist = false)
    private LinkedBlockingQueue<String> tasks = new LinkedBlockingQueue<>();
    @TableField(exist = false)
    private Task task = new Task();
    @TableField(exist = false)
    private Inventory inventory = new Inventory();

    public Long getPlayerId() {
        return playerId;
    }

    public void setPlayerId(long playerId) {
        this.playerId = playerId;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public Integer getLevel() {
        return level;
    }

    public void setLevel(Integer level) {
        this.level = level;
    }

    public Date getLastLoginTime() {
        return lastLoginTime;
    }

    public void setLastLoginTime(Date lastLoginTime) {
        this.lastLoginTime = lastLoginTime;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
